package cn.tedu.store.config.util;

/**
 * 字符处理工具类
 */
public class StringUtil {

    //去符号
   public static String toSymbol(String symbol){
      return   symbol.replaceAll("[[\\s-:punct:]]", "");
    }

    //去英文
   public static String toEnglish(String english) {
       if (english==null){
          return english;
       }
        return english.replaceAll("[a-zA-Z]", "");
    }

    //截取 从a到z
   public static String toSbString(String string,int a,int z){
       if (string == null ){
           return string;
       }

        return string.substring(a,z);
    }
    //符号  截取
    public static String  interceptionSymbol(String string,int a,int z){
       if (string == null){
           return string;
       }
        String s = string.replaceAll("[[\\s-:punct:]]", "");
        return s.substring(a,z);
    }

    //字母  符号  截取
    public static String toAll(String string,int a,int z){
        if (string == null){
            return string;
        }
        String s = string.replaceAll("[[\\s-:punct:]]", "");
        String s1 = s.replaceAll("[a-zA-Z]", "");
        String substring = s1.substring(a, z);
        return substring;


    }
}
